﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Main.Master" AutoEventWireup="true"
    CodeBehind="AddVideo.aspx.cs" Inherits="AUV5.Web.Testing.AddVideo" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="/!js/uploadify_video.js" type="text/javascript"></script>
    <script type="text/javascript">

        var swfVersionStr = "9.0.0";
        var xiSwfUrlStr = "/!js/swfobject/playerProductInstall.swf";
        var flashvars = {};
        var params = {};
        params.quality = "high";
        params.bgcolor = "#000000";
        params.allowscriptaccess = "sameDomain";
        params.allowfullscreen = "true";
        params.wmode = ""; //transparent
        var attributes = {};
        attributes.id = "previewPlayer";
        attributes.name = "previewPlayer";
        attributes.align = "middle";
        $(function () {
            $('.thumbnail').click(function () {
                var imgpath = $(this).find('#imgPath').val();
                var videopath = $(this).find('#videoPath').val();
                if (videopath == '') {
                    $('#videoContent').hide();
                    $('#imgContent').fadeOut('slow', function () {
                        $('#imgContent').fadeIn('slow').attr('src', imgpath);
                    });
                }
                else {
                    $('#imgContent').fadeOut('slow', function () {
                        $('#videoContent').show();
                        swfobject.embedSWF("/!swf/VideoPlayer/VPlayer.swf?t=d&s=&v=" + videopath + "&h=1&lo=1", "flashContent", "400", "300", swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
                    });

                } 
            });
        });

        //swfobject.createCSS("#flashContent", "display:block;text-align:left;");        
    </script>
    <style type="text/css">
        .content_left
        {
            width: 40%;
            float: left;
        }
        .content_right
        {
            width: 59%;
            float: left;
        }
        .left
        {
            width: 20%;
            text-align: right;
            float: left;
        }
        .right
        {
            width: 79%;
            float: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="content_left">
        <div>
            Title: 
            <asp:Label ID="title" Text="" runat="server" />
            <br />
            <br />
            <br />
        </div>
        <div>
            KeyWords:
            <asp:Label ID="tags" Text="" runat="server" />
            <br />
            <br />
            <br />
        </div>
        <div>
            AddBy:
            <asp:Label ID="addby" Text="" runat="server" />
            <br />
            <br />
        </div>
        <div id="fileQueue">
        </div>
        <input type="file" name="uploadify" id="uploadify" />
        <div>
            <a id='upload' onclick="$('#uploadify').uploadifyUpload();return false" href="#">上传</a>&nbsp;&nbsp;|&nbsp;&nbsp;
            <a id="clearQueue" onclick="$('#uploadify').uploadifyClearQueue();" href="#">取消上传</a>
        </div>
        <asp:HiddenField ID="hfpath" runat="server" />
        <asp:Button ID="addVideo" OnClick="addVideo_Click" Text="提交" runat="server" />
        <br />
        <asp:Button id="passVideo" Text="通过审核" runat="server" 
            onclick="passVideo_Click" />
        <br />
        <asp:Button ID="delVideo" Text="删除视频" runat="server" OnClick="delVideo_Click" />
    </div>
    <div class="content_right">
        <div id="attachment">
            <div id="showContent" style="width: 400px; height: 300px; border: 1px solid red;">
                <div>
                    <img id="imgContent" src="" alt="" style="width: 400px; height: 300px; display: none" />
                    <div id="videoContent"  style="display: none; position:absolute">
                        <div id="flashContent">
                            <p>
                                To view this page ensure that Adobe Flash Player version 9.0.0 or greater is installed.
                            </p>
                            <script type="text/javascript">
                                var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
                                document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
                            + pageHost + "www.adobe.com/../images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>"); 
                            </script>
                        </div>
                    </div>
                </div>
            </div>
            <asp:Repeater ID="repAttach" runat="server">
                <ItemTemplate>
                    <div style="width: 90px; float: left; margin-right: 10px; height: 70px; border: 1px solid blue">
                        <a class="thumbnail" href="#">
                            <input id="imgPath" type="hidden" name="name" value="<%#(Container.DataItem as AUV5.Model.ServiceAttachment).ImagePath %>" />
                            <input id="videoPath" type="hidden" name="name" value="<%#(Container.DataItem as AUV5.Model.ServiceAttachment).VideoPath%>" />
                            <img width="90px" height="70px" src='<%#(Container.DataItem as AUV5.Model.ServiceAttachment).ImagePath %>'
                                alt="" />
                        </a>
                    </div>
                </ItemTemplate>
            </asp:Repeater>
        </div>
        <div style="clear:both"></div>
        <div class="left">
            <div>该用户的其它服务</div>
            <div>================</div>
            <asp:Repeater ID="repUserRelated" runat="server">
                <ItemTemplate>
                  <div>  <a href="#"><%#(Container.DataItem as AUV5.Model.ServiceInfo).Title%></a>  </div>
                  <br />
                </ItemTemplate>
            </asp:Repeater>
            <div>================</div>
        </div>
        <div class="right">
           <div>相关服务</div>
           <div>================</div>
            <asp:Repeater ID="repKeyRelated" runat="server">
                <ItemTemplate>
                    <div><a href="#"><%#(Container.DataItem as AUV5.Model.ServiceInfo).Title%></a></div>
                    <br />
                </ItemTemplate>
            </asp:Repeater>
            <div>================</div>
        </div>
    </div>
</asp:Content>
